#coding:utf-8
import time
from common.FuyuanwaiConf import FuyuanwaiConf

__author__ = 'yangxianming'

import json
import requests



def case():
    #1-100福利金买单操作
    #如果返回授权失败 可能是cookie中的SERVERID后面两个时间搓过期
    actionaName = "efuli.welfarepoint.corp.user.query"
    fuyuanwaiConf = FuyuanwaiConf()
    test_url = fuyuanwaiConf.testDomain + "/pointweb/point"

    print(fuyuanwaiConf.proHeaders)
    body = {"request_id":"<style>@keyframes x{}</style><a style=animation-name:x onwebkitanimaionstart=alert(1)></a>"}
    p ={"action":actionaName,"body":body}
    print(p)
    r = requests.post(test_url, data=json.dumps(p), headers=fuyuanwaiConf.proHeaders)
    r_json = r.json()
    print("这个是接口" + actionaName + "返回的全部参数\n", r_json)
    return_code = r_json["return_code"]
    print("返回参数return_code值", return_code)


    return ""

case()